from rest_framework import serializers
from app.models import ClsModel,StudentModel

class ClsSeria(serializers.ModelSerializer):
    class Meta():
        model=ClsModel
        fields='__all__'

class StudentSeria(serializers.ModelSerializer):
    gender=serializers.SerializerMethodField()
    def get_gender(self,obj):
        return obj.get_gender_display()

    cls=serializers.StringRelatedField(read_only=True)

    class Meta():
        model=StudentModel
        fields='__all__'

